﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq.Expressions;
using UnityEngine;

public class MathHelper : MonoBehaviour
{
    public static float OriToDegree(Vector2 vec) {
        if (vec.y<0) {
            return 360 - Vector2.Angle(vec, new Vector2(1, 0));
        }
        else {
            return Vector2.Angle(vec, new Vector2(1, 0));
        }
        //var d = Mathf.Atan(vec.x/Mathf.Sqrt(vec.x*vec.x + vec.y*vec.y))*360f/3.14f;
    }
}
